//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.restaurant.application.customer.support;

import com.google.common.collect.Lists;
import com.nebutown.generation.Convert;
import com.nebutown.generation.PickableBean;
import java.util.List;

public class AddressData implements PickableBean {
    public static final String FN_ID = "id";
    public static final String FN_NAME = "name";
    public static final String FN_PHONE = "phone";
    public static final String FN_PROVINCE = "province";
    public static final String FN_CITY = "city";
    public static final String FN_COUNTY = "county";
    public static final String FN_ADDRESS = "address";
    public static final String FN_ISDEFAULT = "isDefault";
    public static final List<String> FIELD_NAMES = Lists.newArrayList(new String[]{"id", "name", "phone", "province", "city", "county", "address", "isDefault"});
    private String id;
    private String name;
    private String phone;
    private String province;
    private String city;
    private String county;
    private String address;
    private Boolean isDefault;

    public AddressData(String id, String name, String phone, String province, String city, String county, String address, Boolean isDefault) {
        this.setId(id);
        this.setName(name);
        this.setPhone(phone);
        this.setProvince(province);
        this.setCity(city);
        this.setCounty(county);
        this.setAddress(address);
        this.setIsDefault(isDefault);
    }

    public AddressData() {
    }

    public AddressData duplicate() {
        AddressData result = new AddressData();
        result.id = this.id;
        result.name = this.name;
        result.phone = this.phone;
        result.province = this.province;
        result.city = this.city;
        result.county = this.county;
        result.address = this.address;
        result.isDefault = this.isDefault;
        return result;
    }

    public String toString() {
        return Convert.toJson(this);
    }

    public String getId() {
        return this.id;
    }

    public void setId(String value) {
        this.id = value;
    }

    public AddressData withId(String value) {
        this.setId(value);
        return this;
    }

    public AddressData withId(String value, String defaultValue) {
        this.setId(value == null ? defaultValue : value);
        return this;
    }

    public String getName() {
        return this.name;
    }

    public void setName(String value) {
        this.name = value;
    }

    public AddressData withName(String value) {
        this.setName(value);
        return this;
    }

    public AddressData withName(String value, String defaultValue) {
        this.setName(value == null ? defaultValue : value);
        return this;
    }

    public String getPhone() {
        return this.phone;
    }

    public void setPhone(String value) {
        this.phone = value;
    }

    public AddressData withPhone(String value) {
        this.setPhone(value);
        return this;
    }

    public AddressData withPhone(String value, String defaultValue) {
        this.setPhone(value == null ? defaultValue : value);
        return this;
    }

    public String getProvince() {
        return this.province;
    }

    public void setProvince(String value) {
        this.province = value;
    }

    public AddressData withProvince(String value) {
        this.setProvince(value);
        return this;
    }

    public AddressData withProvince(String value, String defaultValue) {
        this.setProvince(value == null ? defaultValue : value);
        return this;
    }

    public String getCity() {
        return this.city;
    }

    public void setCity(String value) {
        this.city = value;
    }

    public AddressData withCity(String value) {
        this.setCity(value);
        return this;
    }

    public AddressData withCity(String value, String defaultValue) {
        this.setCity(value == null ? defaultValue : value);
        return this;
    }

    public String getCounty() {
        return this.county;
    }

    public void setCounty(String value) {
        this.county = value;
    }

    public AddressData withCounty(String value) {
        this.setCounty(value);
        return this;
    }

    public AddressData withCounty(String value, String defaultValue) {
        this.setCounty(value == null ? defaultValue : value);
        return this;
    }

    public String getAddress() {
        return this.address;
    }

    public void setAddress(String value) {
        this.address = value;
    }

    public AddressData withAddress(String value) {
        this.setAddress(value);
        return this;
    }

    public AddressData withAddress(String value, String defaultValue) {
        this.setAddress(value == null ? defaultValue : value);
        return this;
    }

    public Boolean getIsDefault() {
        return this.isDefault;
    }

    public void setIsDefault(Boolean value) {
        this.isDefault = value;
    }

    public AddressData withIsDefault(Boolean value) {
        this.setIsDefault(value);
        return this;
    }

    public AddressData withIsDefault(Boolean value, Boolean defaultValue) {
        this.setIsDefault(value == null ? defaultValue : value);
        return this;
    }

    public Object getValueOf(String name) {
        byte var3 = -1;
        switch(name.hashCode()) {
            case -1354575542:
                if (name.equals("county")) {
                    var3 = 5;
                }
                break;
            case -1147692044:
                if (name.equals("address")) {
                    var3 = 6;
                }
                break;
            case -987485392:
                if (name.equals("province")) {
                    var3 = 3;
                }
                break;
            case 3355:
                if (name.equals("id")) {
                    var3 = 0;
                }
                break;
            case 3053931:
                if (name.equals("city")) {
                    var3 = 4;
                }
                break;
            case 3373707:
                if (name.equals("name")) {
                    var3 = 1;
                }
                break;
            case 106642798:
                if (name.equals("phone")) {
                    var3 = 2;
                }
                break;
            case 965025207:
                if (name.equals("isDefault")) {
                    var3 = 7;
                }
        }

        switch(var3) {
            case 0:
                return this.getId();
            case 1:
                return this.getName();
            case 2:
                return this.getPhone();
            case 3:
                return this.getProvince();
            case 4:
                return this.getCity();
            case 5:
                return this.getCounty();
            case 6:
                return this.getAddress();
            case 7:
                return this.getIsDefault();
            default:
                return null;
        }
    }

    public void setValueOf(String name, Object value) {
        byte var4 = -1;
        switch(name.hashCode()) {
            case -1354575542:
                if (name.equals("county")) {
                    var4 = 5;
                }
                break;
            case -1147692044:
                if (name.equals("address")) {
                    var4 = 6;
                }
                break;
            case -987485392:
                if (name.equals("province")) {
                    var4 = 3;
                }
                break;
            case 3355:
                if (name.equals("id")) {
                    var4 = 0;
                }
                break;
            case 3053931:
                if (name.equals("city")) {
                    var4 = 4;
                }
                break;
            case 3373707:
                if (name.equals("name")) {
                    var4 = 1;
                }
                break;
            case 106642798:
                if (name.equals("phone")) {
                    var4 = 2;
                }
                break;
            case 965025207:
                if (name.equals("isDefault")) {
                    var4 = 7;
                }
        }

        switch(var4) {
            case 0:
                this.setId((String)value);
                return;
            case 1:
                this.setName((String)value);
                return;
            case 2:
                this.setPhone((String)value);
                return;
            case 3:
                this.setProvince((String)value);
                return;
            case 4:
                this.setCity((String)value);
                return;
            case 5:
                this.setCounty((String)value);
                return;
            case 6:
                this.setAddress((String)value);
                return;
            case 7:
                this.setIsDefault((Boolean)value);
                return;
            default:
        }
    }

    public boolean hasField(String name) {
        return FIELD_NAMES.contains(name);
    }

    public int hashCode() {
        return this.signature().hashCode();
    }

    public boolean equals(Object o) {
        return !(o instanceof AddressData) ? false : this.signature().equals(((AddressData)o).signature());
    }

    public String signature() {
        throw new RuntimeException("Bean AddressData has no signature defined, no hash code or equals possible.");
    }
}
